use strict;
use warnings;

my $pwdcnt=0;

while (<>)
{
    my $rep = "<field name=\"password\">PASSWORD $pwdcnt</field>";
    my $reg = "<field name=\"password\">(.+)</field>";

    if (s/$reg/$rep/g)
    {
	warn "replaced PASSWORD $pwdcnt";
	$pwdcnt++;
#	print $_;
    }
    print $_;
}
